"""
读取文件，然后备份，把带有测试字样的丢弃不备份
"""
r_file=open("F:/Python/test03.txt","r",encoding="UTF-8") #读取对象
w_file=open("F:/Python/test04.txt","w",encoding="UTF-8") #写入对象

r_content=r_file.readlines()
print(r_content)
for x in r_content:
    if "测试" in r_content:
        continue
    else:
        w_file.write(x)
r_file.close()
w_file.close()